config = {
	TAB : {
//		tip: '<strong>提示：</strong>这里展示的是系统所管理的表的信息！',
		filter:[ 
		         {type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')",radioflag:'y',checkItems:'rulecode'}
		        ,{type:'label',name:'业务主题',code:'rulecode',storesql:"select distinct rulecode code,rulename name from metadb_struct where dbname='{val}'",where:"topiccode like '{selfval}%'",radioflag:'y'}
		        ,{type:'label',name:'周期',code:'rowcode',storesql:"select rowcode,rowname from metaedimdef where dimname ='表周期'",where:"cycletype in ('{selfval}')",radioflag:'y'}
		        //,{type:'dropDown',name:'高级筛选',code:'rulecode1',storesql:"select distinct rulecode code,rulename name,parentcode from metadb_struct where dbname='{val}'",where:"topiccode like '{selfval}%'"}
		        //,{type:'text',name:'名称',code:'keyval',storesql:"",where:"(dataname like '%{selfval}%' or datacnname like '%{selfval}%' or curdutyer like '%{selfval}%')"}
			],
		toolbar:[
		          //{type:'button',fieldLabel:'新建',width:120,actionId:'createTAB',name:'createTAB'}
			     //,{type:'button',fieldLabel:'导入',width:120,name:'importTAB',fn:function(){ai.addTabSheet("importMeta", '导入元数据',  "/"+contextPath+"/ftl/me/meta_imp/import", true );}}
		         {type:'button',fieldLabel:'导出',width:120,actionId:'exportTAB',name:'exportTAB'}
		         ],
		list:{
			title : '数据',
			sql : "select XMLID,'TAB' OBJTYPE,DATANAME,DATACNNAME,DBNAME,TOPICCODE,TEAM_CODE,CYCLETYPE,ROWNUM_VAL,FIELDNUM,STATE_DATE,STATE,CURDUTYER,REMARK,(CASE WHEN REFCOUNT IS NULL THEN '--' ELSE REFCOUNT END) REFCOUNT from tablefile a where state='PUBLISHED' and (dataname like '%{objname}%' or datacnname like '%{objname}%' /*OR EXISTS (SELECT DISTINCT b.xmlid FROM column_val b WHERE  a.XMLID = b.xmlid AND (colname LIKE '%{objname}%' OR colcnname LIKE '%{objname}%')) */)",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{DATANAME}}" objtype="TAB"> <header class="panel-heading"> <span class="part-one">{{CYCLECNTYPE}}</span> <span class="part-two">{{DBCNNAME}}</span> <ul class="nav nav-pills pull-right"></ul> </header> <div class="row"> <div class="col-md-12" style="padding-left:30px;text-align:left;"> <h5> <b>{{DATANAME}}<b></b></b> </h5> <b><b><small><b>{{DATACNNAME}}&nbsp;</b></small></b></b> </div> </div> <div class="row fieldinfo"></div> <div class="panel-footer bg-light lter text-center" style="margin-top:10px"> <div class="row pull-out"> <div class="col-xs-4"> <div class="padder-v"> <small class="m-b-xs h5 block">{{FIELDCNNUM}}</small><small class="text-muted">字段数</small> </div> </div> <div class="col-xs-4 dk"> <div class="padder-v"> <small class="m-b-xs h5 block">{{REFCOUNT}}</small><small class="text-muted">引用数</small> </div> </div> <div class="col-xs-4" style="padding-right: 10px;"> <div class="padder-v"> <small class="m-b-xs h5 block">{{STATE_DATE}}</small><small class="text-muted">更新时间</small> </div> </div> </div> </div> </div>',
			columns : [{header : "数据库",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/tab.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.DATANAME.toLowerCase()
								+ ","
								+ rowData.DATACNNAME
								+ '</a></h4>'
								+ '  <p><code>数据库:'
								+ getDbCnName(colVal)
								+ '</code>，创建团队：'+getTeamCnName(rowData.TEAM_CODE)+'，主题：'+getTopicCnName(rowData.TOPICCODE)+'<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a></p>'
								+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">' + (rowData.CURDUTYER||'--') + '</a> <i class="fa fa-clock-o icon-muted"></i> ' + rowData.STATE_DATE + ' <a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	TAB_ENTITY: {
		filter:[ 
		         {type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')"}
		        //,{type:'text',name:'名称',code:'tabname',tip:"模板表名,实体表名",storesql:"",where:"(modeltab like '%{selfval}%' or dataname like '%{selfval}%' or datacnname like '%{selfval}%')"}
			],
		toolbar:[{}],
		list:{
			title: '实体表',
			sql : "select XMLID,'TAB_ENTITY' OBJTYPE,DATANAME,DATACNNAME,DBNAME,SCHEMA_NAME,TABSPACE,MODELTAB,CREATOR,FIELDNUM,ROWNUM,(CASE CYCLE_ID WHEN 'day' THEN '日' WHEN 'month' THEN '月' ELSE CYCLE_ID END) CYCLETYPE,STATE_DATE,STATE from tableall ",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{DATANAME}}" objtype="TAB"><header class="panel-heading"><span class="part-one">{{CYCLECNTYPE}} </span><span class="part-two">{{DBCNNAME}}</span><ul class="nav nav-pills pull-right"></ul></header><div class="row"><div class="col-md-12" style="padding-left:30px;text-align:left;"><h5><b>{{DATANAME}}<b></b></b></h5><b><b><small><b>{{DATACNNAME}}&nbsp;</b></small></b></b></div></div><div class="row fieldinfo"></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"><div class="row pull-out"><div class="col-xs-4"><div class="padder-v"><span class="m-b-xs h5 block">{{FIELDNUM}}</span><small class="text-muted">字段数</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><span class="m-b-xs h5 block">{{ROWNUM}}</span><small class="text-muted">记录数</small></div></div><div class="col-xs-4"><div class="padder-v"> <a href="#" class="metaaction red" actid="publishData"> <span class="m-b-xs h5 block"><span class="glyphicon glyphicon glyphicon-bullhorn"></span></span><small class="text-muted red">发布数据</small></a></div></div></div></div></div>',
			columns : [{header : "数据库",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
				render : function(rowData, colVal) {
					var html = '<div class="media">'
							+ '<div class="media-left">'
							+ '<a href="#">'
							+ '    <img class="media-object" alt="" src="/'
							+ contextPath
							+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
							+ '  </a>'
							+ '</div>'
							+ '<div class="media-body">'
							+ '  <h4 class="media-heading"><a href="#">'
							+ rowData.DATANAME
							+ ","
							+ rowData.DATACNNAME
							+ '</a></h4>'
							+ '  <p><code>数据库:'
							+ getDbCnName(colVal)
							+ '&nbsp;&nbsp;</code>,模型表:' + (rowData.MODELTAB||'--') + ',<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a>	</p>'
							+ '  <p class="text-muted m-t-sm small">'+ 'Schema：'+(rowData.SCHEMA_NAME||'--')+ ', 表空间: ' + (rowData.TABSPACE||'--') + '</p>'
							//+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">' + (rowData.CREATOR||'--') + '</a> <i class="fa fa-clock-o icon-muted"></i>' + rowData.STATE_DATE + '<a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
							+ '</div>'
							+ '</div>';
					return html;
					}
				}
			]
		}
	},
	VIEW: {
		filter:[ 
		         {type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')"}
		        //,{type:'text',name:'名称',code:'viewname',storesql:"",where:"(tabname like '%{selfval}%' or view_name like '%{selfval}%' or cnname like '%{selfval}%')"}
			],
		toolbar:[{}],
		list:{
			title: '视图',
			sql : "select XMLID,'VIEW' OBJTYPE,VIEW_NAME,CNNAME,DBNAME,TEAM_CODE,DATATYPE,TABNAME,VIEW_SQL from tableview ",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{VIEW_NAME}}" objtype="VIEW"> <header class="panel-heading"> <span class="part-one"></span><span class="part-two">{{DBCNNAME}}</span> <ul class="nav nav-pills pull-right"></ul> </header> <div class="row"> <div class="col-md-12" style="padding-left:30px;text-align:left;"> <h5> <b>{{VIEW_NAME}} <b></b> </b> </h5> <b><b><small><b>{{CNNAME}}</b></small></b></b> </div> </div> <div class="row fieldinfo"></div> <div class="panel-footer bg-light lter text-center" style="margin-top:10px"> <div class="row pull-out"> <div class="col-xs-4"> <div class="padder-v"> <span class="m-b-xs h5 block">{{TABNAME}}</span> <small class="text-muted">表名</small> </div> </div> <div class="col-xs-4 dk"> <div class="padder-v"> <span class="m-b-xs h5 block">{{TEAM_CODE}}</span> <small class="text-muted">租户</small> </div> </div> <div class="col-xs-4"> <div class="padder-v"> <a href="#" class="metaaction red" actid="publishData"> <span class="m-b-xs h5 block"> <span class="glyphicon glyphicon glyphicon-bullhorn"></span> </span> <small class="text-muted red">发布数据</small></a> </div> </div> </div> </div> </div>',
			columns : [{header : "视图",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.VIEW_NAME.toLowerCase()
								+ ","
								+ rowData.CNNAME
								+ '</a></h4>'
								+ '  <p><code>数据库:'
								+ getDbCnName(colVal)
								+ '&nbsp;&nbsp;</code>来源表：'
								+ rowData.TABNAME
								+ ' <a type="button" class="btn btn-primary btn-xs pull-right">发布数据</a>	</p>'
								+ '  <p class="text-muted m-t-sm small">'
								+ rowData.VIEW_SQL
								+ '</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> team: <a href="#" class="m-r-sm">' + getTeamCnName(rowData.TEAM_CODE) + '</a> <a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	PROCEDURE: {
		filter:[ 
		         {type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')"}
		        //,{type:'text',name:'名称',code:'procname',storesql:"",where:"(procname like '%{selfval}%')"}
			],
		toolbar:[{}],
		list:{
			title: '存储过程',
			sql : "select XMLID,'PROCEDURE' OBJTYPE, DBNAME, PROC_NAME, OBJ_TYPE, PARAM_LIST, PROC_RETURNS, BODY, STATE, SCHEMA_NAME from dag_meta_procedure ",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{PROC_NAME}}" objtype="PROCEDURE"><header class="panel-heading"><span class="part-one">  </span><span class="part-two">{{DBCNNAME}}</span><ul class="nav nav-pills pull-right"></ul></header><div class="row"><div class="col-md-12" style="padding-left:30px;text-align:left;"><h5><b>{{PROC_NAME}}<b></b></b></h5><b><b><small><b>{{DATACNNAME}}&nbsp;</b></small></b></b></div></div><div class="row fieldinfo"></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"><div class="row pull-out"><div class="col-xs-4"><div class="padder-v"><small class="m-b-xs h5 block">{{PARAM_LIST}}</small><small class="text-muted">参数列表</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{PROC_RETURNS}}&nbsp;</small><small class="text-muted">返回</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{STATE}}&nbsp;</small><small class="text-muted">状态</small></div></div></div></div></div>',
			columns : [
				{
					header : "数据库",
					dataIndex : 'DBNAME',
					headerAlign : "center",
					dataAlign : "center",
					width : "80%",
					sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.PROC_NAME
								+ '</a></h4>'
								+ '  <p><code>数据库:'
								+ colVal
								+ '&nbsp;&nbsp;</code>,参数列表:'+rowData.PARAM_LIST+',返回：'+(rowData.PROC_RETURNS||'--')+',<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a>	</p>'
								+ '  <p class="text-muted m-t-sm small">'+(rowData.BODY||'无详细信息')+'</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> Schema: <a href="#" class="m-r-sm">' + (rowData.SCHEMA_NAME||'--') + '</a><a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	FUNC: {
		filter:[ 
		         {type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')"}
		        //,{type:'text',name:'名称',code:'funcname',storesql:"",where:"(FUNC_NAME like '%{selfval}%')"}
			],
		toolbar:[{}],
		list:{
			title: '函数',
			sql : "select XMLID,'FUNC' OBJTYPE, DBNAME, FUNC_NAME, OBJ_TYPE, PARAM_LIST, FUNC_RETURNS, BODY, STATE, SCHEMA_NAME from dag_meta_func ",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{FUNC_NAME}}" objtype="FUNC"><header class="panel-heading"><span class="part-one">  </span><span class="part-two">{{DBCNNAME}}</span><ul class="nav nav-pills pull-right"></ul></header><div class="row"><div class="col-md-12" style="padding-left:30px;text-align:left;"><h5><b>{{FUNC_NAME}}<b></b></b></h5><b><b><small><b>{{DATACNNAME}}&nbsp;</b></small></b></b></div></div><div class="row fieldinfo"></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"><div class="row pull-out"><div class="col-xs-4"><div class="padder-v"><small class="m-b-xs h5 block">{{PARAM_LIST}}</small><small class="text-muted">参数列表</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{FUNC_RETURNS}}</small><small class="text-muted">返回</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{STATE}}&nbsp;</small><small class="text-muted">状态</small></div></div></div></div></div>',
			columns : [{header : "数据库",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.FUNC_NAME
								+ '</a></h4>'
								+ '  <p><code>数据库:'
								+ colVal
								+ '&nbsp;&nbsp;</code>,参数列表:'+rowData.PARAM_LIST+',返回：'+(rowData.FUNC_RETURNS||'--')+',<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a>	</p>'
								+ '  <p class="text-muted m-t-sm small">'+(rowData.BODY||'无详细信息')+'</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> Schema: <a href="#" class="m-r-sm">' + (rowData.SCHEMA_NAME||'--') + '</a><a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	TRIG: {
		filter:[ 
		         {type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')"}
		        //,{type:'text',name:'名称',code:'triggername',storesql:"",where:"(TRIGGER_NAME like '%{selfval}%')"}
			],
		toolbar:[{}],
		list:{
			title: '触发器',
			sql : "select XMLID,'TRIG' OBJTYPE,DBNAME,TRIGGER_NAME,TRIGGER_SCHEMA,EVENT_MANIPULATION,EVENT_OBJECT_SCHEMA,EVENT_OBJECT_TABLE,ACTION_STATEMENT,ACTION_ORIENTATION,ACTION_TIMING,OBJ_TYPE,STATE from dag_meta_trig ",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{TRIGGER_NAME}}" objtype="TRIG"><header class="panel-heading"><span class="part-one"> </span><span class="part-two">{{DBCNNAME}}</span><ul class="nav nav-pills pull-right"></ul></header><div class="row"><div class="col-md-12" style="padding-left:30px;text-align:left;"><h5><b>{{TRIGGER_NAME}}<b></b></b></h5><b><b><small><b>{{DATACNNAME}}&nbsp;</b></small></b></b></div></div><div class="row fieldinfo"></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"><div class="row pull-out"><div class="col-xs-4"><div class="padder-v"><small class="m-b-xs h5 block">{{EVENT_MANIPULATION}}</small><small class="text-muted">操作类型</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><span class="m-b-xs h5 block">{{EVENT_OBJECT_TABLE}}</span><small class="text-muted">操作对象</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{STATE}}&nbsp;</small><small class="text-muted">状态</small></div></div></div></div></div>',
			columns : [{header : "数据库",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.TRIGGER_NAME
								+ '</a></h4>'
								+ '  <p><code>数据库:'
								+ colVal
								+ '&nbsp;&nbsp;</code>,操作类型：'+(rowData.EVENT_MANIPULATION||'--')+',触发时间：'+(rowData.ACTION_TIMING||'--')+',<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a>	</p>'
								+ '  <p class="text-muted m-t-sm small">'+(rowData.ACTION_STATEMENT||'无操作语句')+'</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> 所属用户名: <a href="#" class="m-r-sm">' + (rowData.TRIGGER_SCHEMA||'--') + '</a> <a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	DATABASE_ACCT: {
		filter:[ 
		         {type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')"}
		        //,{type:'text',name:'名称',code:'triggername',storesql:"",where:"(TRIGGER_NAME like '%{selfval}%')"}
			],
		toolbar:[{}],
		list:{
			title:'数据库账号',
			sql : "select XMLID,'DATABASE_ACCT' OBJTYPE,DBNAME,ACCT_NAME,MAP_TEAMS,REMARK from metadb_acct",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{ACCT_NAME}}" objtype="DATABASE_ACCT"> <header class="panel-heading"> <span class="part-one"></span><span class="part-two">{{DBCNNAME}}</span> <ul class="nav nav-pills pull-right"></ul> </header> <div class="row"> <div class="col-md-12" style="padding-left:30px;text-align:left;"> <h5> <b>{{ACCT_NAME}} <b></b> </b> </h5> <b><b><small><b>{{MAP_TEAMS}}&nbsp;</b></small></b></b> </div> </div> <div class="row fieldinfo"></div> <div class="panel-footer bg-light lter text-center" style="margin-top:10px"> <div class="row pull-out"> <div class="col-xs-6"> <div class="padder-v"> <small class="m-b-xs h5 block">{{REMARK}}</small> <small class="text-muted">备注</small> </div> </div> <div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{STATE}}&nbsp;</small><small class="text-muted">&nbsp;</small></div></div></div> </div> </div>',
			columns : [{header : "数据库账号",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/database/database_acct.jpg" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.ACCT_NAME
								+ '</a></h4>'
								+ '  <p><code>数据库:'
								+ getDbCnName(colVal)
								+ '&nbsp;&nbsp;</code>,映射团队:'+rowData.MAP_TEAMS+',<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a>	</p>'
								+ '  <small class="text-muted">'+(rowData.REMARK||'无详细信息')+'</small>'
								+ '<div class="text-muted"><a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	INTER: {
		filter:[ 
		         {type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')",radioflag:'y',checkItems:'rulecode'}
		        ,{type:'label',name:'业务主题',code:'rulecode',storesql:"select distinct rulecode code,rulename name from metadb_struct where dbname='{val}'",where:"topiccode like '{selfval}%'",radioflag:'y'}
		        ,{type:'label',name:'周期',code:'rowcode',storesql:"select rowcode,rowname from metaedimdef where dimname ='接口采集周期'",where:"inter_cycle = '{selfval}'",radioflag:'y'}
		        //,{type:'text',name:'名称',code:'keyval',storesql:"",where:"(fullintercode like '%{selfval}%' or inter_name like '%{selfval}%' or curdutyer like '%{selfval}%')"}
			],
		toolbar:[
		          {type:'button',fieldLabel:'导出',width:120,actionId:'exportINTER',name:'exportINTER'}
		         ],
		list:{
			title: '接口',
			sql : "select XMLID,'INTER' OBJTYPE,FULLINTERCODE,INTER_NAME,DBNAME,INTER_CYCLE CYCLETYPE,SOURCE_TABLE,ACTIVE_TIME,END_TIME,UPDATE_TIME,TARGET_TABLE,SOURCEDIR,CREATER,CURDUTYER,REMARK from inter_cfg WHERE state='PUBLISHED' and (fullintercode LIKE '%{objname}%' OR inter_name LIKE '%{objname}%' OR target_table LIKE '%{objname}%' OR source_table LIKE '%{objname}%')",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{FULLINTERCODE}}" objtype="INTER"><header class="panel-heading"><span class="part-one">{{CYCLECNTYPE}} </span><span class="part-two">{{DBCNNAME}}</span><ul class="nav nav-pills pull-right"></ul></header><div class="row"><div class="col-md-12" style="padding-left:30px;text-align:left;"><h5><b>{{FULLINTERCODE}}<b></b></b></h5><b><b><small><b>{{INTER_NAME}}&nbsp;</b></small></b></b></div></div><div class="row fieldinfo"></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"><div class="row pull-out"><div class="col-xs-4"><div class="padder-v"><small class="m-b-xs h5 block">{{SOURCEDIR}}</small><small class="text-muted">源</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{TARGET_TABLE}}</small><small class="text-muted">目标表</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{CURDUTYER}}&nbsp;</small><small class="text-muted">责任人</small></div></div></div></div></div>',
			columns : [{header : "数据库",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/inter.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.FULLINTERCODE
								+ ","
								+ rowData.INTER_NAME
								+ '</a></h4>'
								+ '  <p><code>数据库：'
								+ getDbCnName(colVal)
								+ '</code><small>，周期：'+getRowName('DIM_INTERINTERCYCLE',rowData.CYCLETYPE)+'，源：'+(rowData.SOURCE_SYS||rowData.SOURCE_TABLE||'--')+'，目标表：'+(rowData.TARGET_TABLE||'--')+'</small><a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a>	</p>'
								+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">' + (rowData.CURDUTYER||'--') + '</a> <i class="fa fa-clock-o icon-muted"></i> ' + (rowData.ACTIVE_TIME||'--') + '<a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	PROC: {
		filter:[ 
				{type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')",radioflag:'y',checkItems:'rulecode'}
				,{type:'label',name:'业务主题',code:'rulecode',storesql:"select distinct rulecode code,rulename name,parentcode from metadb_struct where dbname='{val}'",where:"topiccode like '{selfval}%'",radioflag:'y'}
				,{type:'label',name:'周期',code:'rowcode',storesql:"select rowcode,rowname from metaedimdef where dimname ='周期编号'",where:"cycletype in ('{selfval}')",radioflag:'y'}
		        //,{type:'text',name:'名称',code:'keyval',storesql:"",where:"(proc_name like '%{selfval}%' or proccnname like '%{selfval}%' or curdutyer like '%{selfval}%')"}
			],
		toolbar:[
		         //{type:'button',fieldLabel:'新建',width:120,actionId:'createPROC',name:'createPROC'}
		         {type:'button',fieldLabel:'导出',width:120,actionId:'exportPROC',name:'exportPROC'}
		         ],
		list:{
			title: '程序',
			sql : "select XMLID,'PROC' OBJTYPE,PROC_NAME,PROCCNNAME,INTERCODE,DBNAME,CYCLETYPE,TOPICCODE,TOPICNAME,STARTDATE,PARENTPROC,EXTEND_CFG,TEAM_CODE,CREATER,CURDUTYER,STATE_DATE,STATE,REMARK from proc a WHERE state='PUBLISHED' and (proc_name LIKE '%{objname}%' OR proccnname LIKE '%{objname}%' OR EXISTS(SELECT 1 FROM transdatamap_design b WHERE a.XMLID = b.transname AND ((b.SOURCETYPE = 'DATA' AND EXISTS(SELECT 1 FROM tablefile c WHERE b.SOURCE = c.XMLID AND (c.DATANAME LIKE '%{objname}%' OR c.DATACNNAME LIKE '%{objname}%'))) OR (b.TARGETTYPE = 'DATA' AND EXISTS(SELECT 1 FROM tablefile c WHERE b.TARGET = c.XMLID AND (c.DATANAME LIKE '%{objname}%' OR c.DATACNNAME LIKE '%{objname}%'))))))",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{PROC_NAME}}" objtype="PROC"><header class="panel-heading"><span class="part-one">{{CYCLECNTYPE}}&nbsp;</span><span class="part-two">{{DBCNNAME}}</span><ul class="nav nav-pills pull-right"></ul></header><div class="row"><div class="col-md-12" style="padding-left:30px;text-align:left;"><h5><b>{{PROC_NAME}}<b></b></b></h5><b><b><small><b>{{PROCCNNAME}}&nbsp;</b></small></b></b></div></div><div class="row fieldinfo"></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"><div class="row pull-out"><div class="col-xs-4"><div class="padder-v"><small class="m-b-xs h5 block">{{CURDUTYER}}</small><small class="text-muted">责任人</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{EXTEND_CFG}}</small><small class="text-muted">扩展配置</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{STATECN}}&nbsp;</small><small class="text-muted">状态</small></div></div></div></div></div>',
			columns : [{header : "数据库",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/proc.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.PROC_NAME
								+ ","
								+ rowData.PROCCNNAME
								+ '</a></h4>'
								+ '  <p><code>数据库:'
								+ getDbCnName(colVal)
								+ '</code>，创建团队：'+getTeamCnName(rowData.TEAM_CODE)+'，主题：'+(getTopicCnName(rowData.TOPICCODE)||'--')+'<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a>	</p>'
								+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">' + (rowData.CURDUTYER||'--') + '</a> <i class="fa fa-clock-o icon-muted"></i>' + rowData.STATE_DATE + '<a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	DATAFLOW: {
		filter:[ 
		         {type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')"}
		        ,{type:'label',name:'主题',code:'rulecode',storesql:"select distinct rulecode,rulename from metadb_struct where dbname='METADB' and (parentcode IS NULL or parentcode='')",where:"topiccode like '%{selfval}%'"}
		        ,{type:'label',name:'周期',code:'rowcode',storesql:"select rowcode,rowname from metaedimdef where dimcode ='程序周期'",where:"inter_cycle = '{selfval}'"}
		        //,{type:'text',name:'名称',code:'keyval',storesql:"",where:"(FLOWCODE like '%{selfval}%' or FLOWNAME like '%{selfval}%' or curdutyer like '%{selfval}%')"}
			],
		toolbar:[{type:'hidden',fieldLabel:'',width:120}],
		list:{
			title: '数据流程',
			ignoreParams: 'dbname',
			sql : "select XMLID,'DATAFLOW' OBJTYPE,FLOWCODE,FLOWNAME,PARENTCODE,TOPICNAME,CYCLETYPE,CRON_EXP,DEVELOPER,CREATER,DESIGNER,EFF_DATE,CURDUTYER,TEAM_CODE,VERSEQ,STATE_DATE,STATE,REMARK from transflow ",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{FLOWCODE}}" objtype="DATAFLOW"><header class="panel-heading"><span class="part-one">{{CYCLECNTYPE}}&nbsp;</span><span class="part-two">&nbsp;</span><ul class="nav nav-pills pull-right"></ul></header><div class="row"><div class="col-md-12" style="padding-left:30px;text-align:left;"><h5><b>{{FLOWCODE}}<b></b></b></h5><b><b><small><b>{{FLOWNAME}}&nbsp;</b></small></b></b></div></div><div class="row fieldinfo"></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"><div class="row pull-out"><div class="col-xs-4"><div class="padder-v"><small class="m-b-xs h5 block">{{CURDUTYER}}</small><small class="text-muted">责任人</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{VERSEQ}}</small><small class="text-muted">版本号</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{STATE}}&nbsp;</small><small class="text-muted">状态</small></div></div></div></div></div>',
			columns : [{header : "数据库",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.FLOWCODE
								+ ","
								+ rowData.FLOWNAME
								+ '</a></h4>'
								+ '  <p><code>状态:'
								+ (rowData.STATE||'--')
								+ '&nbsp;&nbsp;</code>,创建团队:'+getTeamCnName(rowData.TEAM_CODE)+',主题：'+(rowData.TOPICNAME||'--')+',<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a>	</p>'
								+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">' + (rowData.CURDUTYER||'--') + '</a> <i class="fa fa-clock-o icon-muted"></i>' + rowData.STATE_DATE + '<a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	DATATRANS: {
		filter:[ 
		         {type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')"}
		        ,{type:'label',name:'主题',code:'rulecode',storesql:"select distinct rulecode,rulename from metadb_struct where dbname='METADB' and (parentcode IS NULL or parentcode='')",where:"topiccode like '%{selfval}%'"}
		        ,{type:'label',name:'周期',code:'rowcode',storesql:"select rowcode,rowname from metaedimdef where dimcode ='程序周期'",where:"inter_cycle = '{selfval}'"}
		        //,{type:'text',name:'名称',code:'keyval',storesql:"",where:"(DIS_NAME like '%{selfval}%' or DISCNNAME like '%{selfval}%')"}
			],
		toolbar:[{type:'hidden',fieldLabel:'',width:120}],
		list:{
			title: '数据分发',
			ignoreParams: 'dbname',
			sql : "select XMLID,'DATATRANS' OBJTYPE,DIS_NAME,DISCNNAME,DES_TABLE_NAME,EXPORT_SQL,OPERATE_SQL,SOURCE_DBNAME,SOURCE_TABLENAME,SOURCE_XMLID,TARGET_TYPE,TARGET_DBNAME,TARGET_TABLENAME,TARGET_XMLID,TEAM_CODE,CUR_CREATER,UPDATE_TIME,IS_ACTIVE,CFG_REMARK from distribute_cfg",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{DIS_NAME}}" objtype="DATATRANS"><header class="panel-heading"><span class="part-one">目标库：</span><span class="part-two">{{TARGET_DBNAME}}</span><ul class="nav nav-pills pull-right"></ul></header><div class="row"><div class="col-md-12" style="padding-left:30px;text-align:left;"><h5><b>{{DIS_NAME}}&nbsp;<b></b></b></h5><b><b><small><b>{{DISCNNAME}}&nbsp;</b></small></b></b></div></div><div class="row fieldinfo"></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"><div class="row pull-out"><div class="col-xs-4"><div class="padder-v"><small class="m-b-xs h5 block">{{TEAM_CODE}}</small><small class="text-muted">团队</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{DES_TABLE_NAME}}&nbsp;</small><small class="text-muted">目标表名</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{IS_ACTIVE}}&nbsp;</small><small class="text-muted">状态</small></div></div></div></div></div>',
			columns : [{header : "数据库",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.DIS_NAME
								+ ","
								+ rowData.DISCNNAME
								+ '</a></h4>'
								+ '  <p><code>状态:'
								+ (rowData.IS_ACTIVE||'--')
								+ '&nbsp;&nbsp;</code>,创建团队:'+getTeamCnName(rowData.TEAM_CODE)+',源数据库：'+(rowData.SOURCE_DBNAME||'--')+'  目标数据库：'+(rowData.TARGET_DBNAME||'--')+',<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a>	</p>'
								+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">' + (rowData.CUR_CREATER||'--') + '</a> <i class="fa fa-clock-o icon-muted"></i>' + (rowData.UPDATE_TIME||'--') + '<a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	ZB: {
		filter:[ 
		         {type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')",radioflag:'y'}
		        //{type:'tree',name:'业务分类',code:'rulecode',storesql:"select distinct rulecode code,rulename name,parentcode from metadb_struct where dbname='METADB'",where:"topiccode like '{selfval}%'"}
		        ,{type:'label',name:'周期',code:'rowcode',storesql:"select rowcode,rowname from metaedimdef where dimname ='指标周期'",where:"cycletype = '{selfval}'",radioflag:'y'}
		        //,{type:'text',name:'名称',code:'keyval',storesql:"",where:"(ZB_CODE like '%{selfval}%' or ZB_NAME like '%{selfval}%')"}
			],
		toolbar:[
		         //{type:'hidden',fieldLabel:'',width:120}
		         {type:'button',fieldLabel:'导出',width:120,actionId:'exportTAB',name:'exportTAB'}
		         ],
		list:{
			title: '指标',
			sql : "select XMLID,'ZB' OBJTYPE,ZB_CODE,ZB_NAME,ZB_TYPE,DBNAME,CYCLETYPE,TOPICCODE,BUSI_DESCR,TECH_DESCR,SOURCE_TAB,SOURCE_PROC,SOURCE_ZB,CREATER,CREATE_DATE,CURDUTYER,TEAM_CODE,VERSEQ,STATE_DATE,STATE,OP_TIME,REMARK from dag_meta_zb WHERE state='PUBLISHED' and (zb_code LIKE '%{objname}%' OR zb_name LIKE '%{objname}%' OR source_tab LIKE '%{objname}%')",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{ZB_CODE}}" objtype="ZB"><header class="panel-heading"><span class="part-one">{{CYCLECNTYPE}}&nbsp;</span><span class="part-two">{{DBCNNAME}}</span><ul class="nav nav-pills pull-right"></ul></header><div class="row"><div class="col-md-12" style="padding-left:30px;text-align:left;"><h5><b>{{ZB_CODE}}<b></b></b></h5><b><b><small><b>{{ZB_NAME}}&nbsp;</b></small></b></b></div></div><div class="row fieldinfo"></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"><div class="row pull-out"><div class="col-xs-4"><div class="padder-v"><small class="m-b-xs h5 block">{{CURDUTYER}}</small><small class="text-muted">责任人</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{VERSEQ}}</small><small class="text-muted">版本号</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{STATECN}}&nbsp;</small><small class="text-muted">状态</small></div></div></div></div></div>',
			columns : [
				{
					header : "数据库",
					dataIndex : 'DBNAME',
					headerAlign : "center",
					dataAlign : "center",
					width : "80%",
					sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/zb.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.ZB_CODE
								+ ","
								+ rowData.ZB_NAME
								+ '</a></h4>'
								+ '  <p><code>数据库:'
								+ getDbCnName(colVal)
								+ '</code>，创建团队：'+getTeamCnName(rowData.TEAM_CODE)+'，指标类型：'+(getRowName('DIM_ZB_TYPE',rowData.ZB_TYPE)||'--')+'<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a>	</p>'
								+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">' + (rowData.CURDUTYER||'--') + '</a> <i class="fa fa-clock-o icon-muted"></i>' + rowData.STATE_DATE + '<a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	APP: {
		filter:[ 
		         {type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')"}
		        ,{type:'label',name:'主题',code:'rulecode',storesql:"select distinct rulecode,rulename from metadb_struct where dbname='METADB' and (parentcode IS NULL or parentcode='')",where:"topiccode like '%{selfval}%'"}
		        ,{type:'label',name:'周期',code:'rowcode',storesql:"select rowcode,rowname from metaedimdef where dimcode ='指标周期'",where:"inter_cycle = '{selfval}'"}
		        //,{type:'text',name:'名称',code:'keyval',storesql:"",where:"(APP_CODE like '%{selfval}%' or APP_NAME like '%{selfval}%')"}
			],
		toolbar:[{type:'hidden',fieldLabel:'',width:120}],
		list:{
			title: '应用',
			sql : "select XMLID,'APP' OBJTYPE,APP_CODE,APP_NAME,DBNAME,CYCLETYPE,TOPICCODE,PROVIDER,DEV_TYPE,REQUEST_URL,VERSION,SOURCE_TAB,SOURCE_PROC,SOURCE_ZB,SOURCE_DIM,CREATER,STATE_DATE,STATE,APP_DESCR from dag_meta_app ",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{APP_CODE}}" objtype="APP"><header class="panel-heading"><span class="part-one">{{CYCLECNTYPE}}</span><span class="part-two">{{DBCNNAME}}</span><ul class="nav nav-pills pull-right"></ul></header><div class="row"><div class="col-md-12" style="padding-left:30px;text-align:left;"><h5><b>{{APP_CODE}}<b></b></b></h5><b><b><small><b>{{APP_NAME}}&nbsp;</b></small></b></b></div></div><div class="row fieldinfo"></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"><div class="row pull-out"><div class="col-xs-4"><div class="padder-v"><small class="m-b-xs h5 block">{{PROVIDER}}&nbsp;</small><small class="text-muted">供应商</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><small class="m-b-xs h5 block">{{VERSION}}</small><small class="text-muted">版本</small></div></div><div class="col-xs-4"><div class="padder-v"> <a href="#" class="metaaction red" actid="publishData"> <span class="m-b-xs h5 block"><span class="glyphicon glyphicon glyphicon-bullhorn"></span></span><small class="text-muted red">发布数据</small></a></div></div></div></div></div>',
			columns : [{header : "数据库",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.APP_CODE
								+ ","
								+ rowData.APP_NAME
								+ '</a></h4>'
								+ '  <p><code>数据库:'
								+ colVal
								+ '&nbsp;&nbsp;</code>,供应商:'+rowData.PROVIDER+',版本：'+(rowData.VERSION||'--')+',<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a>	</p>'
								+ '  <p class="text-muted m-t-sm small">'+(rowData.APP_DESCR||'无详细信息')+'</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">' + (rowData.CREATER||'--') + '</a> <i class="fa fa-clock-o icon-muted"></i>' + rowData.STATE_DATE + '<a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	DATABASE: {
		filter:[
//		        {type:'label',name:'类型',code:'rowcode',storesql:"mysql,oracle,db2,gp,hadoop,hive,hbase,gbase",where:"alias in '({selfval})'"}
//		        ,{type:'text',name:'名称',code:'keyval',storesql:"",where:"(dbname like '%{selfval}%' or cnname like '%{selfval}%')"}
			],
		toolbar:[
		         {type:'text',fieldLabel:'对象名称',width:120,name:'name',where:"(upper(DBNAME) like upper('%{name}%') or upper(CNNAME) like upper('%{name}%'))"},
		         {type:'button',fieldLabel:'查询',width:120,name:'query',actionId:'queryMetaObj'},
		         {type:'button',fieldLabel:'新建',width:120,actionId:'createDATABASE',name:'createDATABASE'}
		         ],
		list:{
			title: '数据库实例',
			sql : "select  XMLID,DBNAME,CNNAME,'DATABASE' OBJTYPE,URL,ALIAS from metadbcfg",
			tpl:'<div class="dacptiles panel panel-success" id="{{XMLID}}" title="{{CNNAME}}" objtype="DATABASE" style=" width: 260px;height: 120px; overflow:hidden"><div class="row"><div class="col-md-4" style=" margin-top: -15px;">  <div style="margin-left:10px;  width: 10px; height: 10px; position: absolute;">  </div>  <div class="hotspan pull-left" >   <img class="img " src="/'+contextPath+'/dacp-res/catalog/common/images/database/{{ALIAS}}.png" style="margin-top:15px;margin-left:10px; width: 64px;  height: 64px; " />  </div> </div> <div class="col-md-7">  <div style="margin-left:10px;margin-top:20px;">   <h5> {{DBNAME}} </h5>   <small>{{CNNAME}}</small>  </div> </div></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"> <div class="row pull-out">  <div class="col-xs-4">   <div class="padder-v">    <span class="m-b-xs h5 block ">&nbsp;</span>    <small id="db-detail" class="text-muted">详细</small>   </div>  </div>  <div class="col-xs-4 dk">   <div class="padder-v">    <span class="m-b-xs h5 block ">&nbsp;</span>    <small id="db-edit" class="text-muted">修改</small>   </div>  </div>  <div class="col-xs-4">   <div class="padder-v">    <span class="m-b-xs h5 block ">&nbsp;</span>    <small id="db-delete" class="text-muted">删除</small>   </div>  </div> </div></div></div>',
			cardElementClick:{
				".dacptiles.panel #db-detail":function(model,objtype,objid){
					var rec = model.meta.getMetaObjBaseInfo(objtype, objid, 'record');
					model.meta.metaAction({actionkey:'default',objtype:objtype},rec);
				},
				".dacptiles.panel #db-edit":function(model,objtype,objid){
					var rec = model.meta.getMetaObjBaseInfo(objtype, objid, 'record');
					model.meta.metaAction({actionkey:'edit',objtype:objtype},rec);
				},
				".dacptiles.panel #db-delete":function(model,objtype,objid){
					var rec = model.meta.getMetaObjBaseInfo(objtype, objid, 'record');
					model.meta.metaAction({actionkey:'delete',objtype:objtype},rec);
					model.listView.reload();
				}
			},
			columns : [{header : "数据库",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
				render : function(rowData, colVal) {
					var html = '<div class="media">'
							+ '<div class="media-left">'
							+ '<a href="#">'
							+ '    <img class="media-object" alt="" src="/'
							+ contextPath
							+ '/dacp-res/catalog/common/images/database/'+rowData.ALIAS+'.png" style="width: 64px; height: 64px;">'
							+ '  </a>'
							+ '</div>'
							+ '<div class="media-body">'
							+ '  <h4 class="media-heading"><a href="#">'
							+ rowData.DBNAME
							+ ","
							+ rowData.CNNAME
							+ '</a></h4>'
							+ '  <p><code>数据库类型:'
							+ rowData.ALIAS
							+ '</code><a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a></p>'
							+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
							+ '</div>'
							+ '</div>';
					return html;
					}
				}
			]
		}
	},
	TEAM: {
		filter:[
//		        {type:'label',name:'类型',code:'rowcode',storesql:"mysql,oracle,db2,gp,hadoop,hive,hbase,gbase",where:"alias in '({selfval})'"}
//		        ,{type:'text',name:'名称',code:'keyval',storesql:"",where:"(dbname like '%{selfval}%' or cnname like '%{selfval}%')"}
			],
		toolbar:[
		         {type:'text',fieldLabel:'对象名称',width:120,name:'name',where:"(upper(TEAM_CODE) like upper('%{name}%') or upper(TEAM_NAME) like upper('%{name}%'))"},
		         {type:'button',fieldLabel:'查询',width:120,name:'query',actionId:'queryMetaObj'},
		         {type:'button',fieldLabel:'新建',width:120,actionId:'createTEAM',name:'createTEAM'}
		         ],
		list:{
			title: '租户实例',
			sql : "select XMLID, 'TEAM' OBJTYPE, TEAM_CODE, TEAM_NAME, TEAM_TYPE, START_DATE, END_DATE, STATE, REMARK, TEAM_MGR from meta_team",
			tpl:'<div class="dacptiles panel panel-success" id="{{XMLID}}" title="{{TEAM_NAME}}" objtype="TEAM" style=" width: 260px;height: 120px; overflow:hidden"><div class="row"><div class="col-md-4" style=" margin-top: -15px;">  <div style="margin-left:10px;  width: 10px; height: 10px; position: absolute;">  </div>  <div class="hotspan pull-left" >   <img class="img " src="/'+contextPath+'/dacp-res/catalog/common/images/database/database_acct.jpg" style="margin-top:10px;margin-left:10px; width: 64px;  height: 64px; " />  </div> </div> <div class="col-md-7">  <div style="margin-left:10px;margin-top:20px;">   <h5> {{TEAM_CODE}} </h5>   <small>{{TEAM_NAME}}</small>  </div> </div></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"> <div class="row pull-out">  <div class="col-xs-4">   <div class="padder-v">    <span class="m-b-xs h5 block ">--</span>    <small class="text-muted">详细</small>   </div>  </div>  <div class="col-xs-4 dk">   <div class="padder-v">    <span class="m-b-xs h5 block ">--</span>    <small class="text-muted">修改</small>   </div>  </div>  <div class="col-xs-4">   <div class="padder-v">    <span class="m-b-xs h5 block ">--</span>    <small class="text-muted">删除</small>   </div>  </div> </div></div></div>',
			columns : [{header : "团队",dataIndex : 'TEAM_CODE',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
				render : function(rowData, colVal) {
					var html = '<div class="media">'
							+ '<div class="media-left">'
							+ '<a href="#">'
							+ '    <img class="media-object" alt="" src="/'
							+ contextPath
							+ '/dacp-res/catalog/common/images/database/database_acct.jpg" style="width: 60px; height: 79px;">'
							+ '  </a>'
							+ '</div>'
							+ '<div class="media-body">'
							+ '  <h4 class="media-heading"><a href="#">'
							+ getTeamCnName(rowData.TEAM_CODE)
							+ ","
							+ rowData.TEAM_NAME
							+ '</a></h4>'
							+ '  <p><code>租户管理员:'
							+ rowData.TEAM_MGR
							+ '</code><a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a></p>'
							+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
							+ '</div>'
							+ '</div>';
					return html;
					}
				}
			]
		}
	},
	SOFT: {
		filter:[
//		        {type:'text',name:'名称',code:'keyval',storesql:"",where:"(SOFTSYSCODE like '%{selfval}%' or SYSTEM_NAME like '%{selfval}%')"}
			],
		toolbar:[
				{type:'text',fieldLabel:'对象名称',width:120,name:'name',where:"(upper(SOFTSYSCODE) like upper('%{name}%') or upper(SYSTEM_NAME) like upper('%{name}%'))"},
				{type:'button',fieldLabel:'查询',width:120,name:'query',actionId:'queryMetaObj'},
		        {type:'button',fieldLabel:'新建',width:120,actionId:'createSOFT',name:'createSOFT'}
		         ],
		list:{
			title: '软件实例',
			sql : "SELECT XMLID, 'SOFT' OBJTYPE, SOFTSYSCODE,SYSTEM_NAME,TYPECODE,VERSION,REMARK FROM metasoftcfg",
			tpl:'<div class="dacptiles panel panel-success" id="{{XMLID}}" title="{{SYSTEM_NAME}}" objtype="SOFT" style=" width: 260px;height: 125px; overflow:hidden"><div class="row"><div class="col-md-4" style=" margin-top: -15px;">  <div style="margin-left:10px;  width: 10px; height: 10px; position: absolute;">  </div>  <div class="hotspan pull-left">   <span class="glyphicon glyphicon-cog "   style="margin-top:20px;margin-left:10px; width: 64px;  height: 64px;font-size:64px " />  </div> </div> <div class="col-md-7">  <div style="margin-left:10px;margin-top:20px;">   <h5> {{SYSTEM_NAME}} </h5>   <small>{{TYPECODE}},{{REMARK}}</small>  </div> </div></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"> <div class="row pull-out">  <div class="col-xs-4">   <div class="padder-v">    <span class="m-b-xs h5 block ">{{VERSION}}</span>    <small class="text-muted">版本号</small>   </div>  </div>  <div class="col-xs-4 dk">   <div class="padder-v">    <span class="m-b-xs h5 block ">--</span>    <small class="text-muted">卸载</small>   </div>  </div>  <div class="col-xs-4">   <div class="padder-v">    <span class="m-b-xs h5 block ">--</span>    <small class="text-muted">升级</small>   </div>  </div> </div></div></div>',
			columns : [{header : "XMLID",dataIndex : 'XMLID',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
				render : function(rowData, colVal) {
					var html = '<div class="media">'
							+ '<div class="media-left">'
							+ '<a href="#">'
							+ '    <img class="media-object" alt="" src="/'
							+ contextPath
							+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
							+ '  </a>'
							+ '</div>'
							+ '<div class="media-body">'
							+ '  <h4 class="media-heading"><a href="#">'
							+ rowData.SOFTSYSCODE
							+ ","
							+ rowData.SYSTEM_NAME
							+ '</a></h4>'
							+ '  <p><code>类型:'
							+ rowData.TYPECODE
							+ '</code><a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a></p>'
							+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
							+ '</div>'
							+ '</div>';
					return html;
					}
				}
			]
		}
	},
	OPENAPI : {
		filter:[ 
//			 {type:'label',name:'供应者',code:'CREATE_USER',storesql:"SELECT DISTINCT creater FROM DAG_META_API ",where:"creater in('{selfval}')"}
			 {type:'label',name:'服务类型',code:'openapi_type',storesql:"select rowcode,rowname from metaedimdef where dimcode ='DIM_OPENAPI_TYPE'",where:"api_type = '{selfval}'",radioflag:'y'}
			,{type:'label',name:'业务归属',code:'openapi_topiccode',storesql:"select rowcode,rowname from metaedimdef where dimcode ='DIM_OPENAPI_TOPICCODE'",where:"topiccode = '{selfval}'",radioflag:'y'}
			//,{type:'text',name:'名称',code:'openapi_name',where:"API_NAME like '%{selfval}%'" }
		],
		toolbar:[
		         // {type:'button',fieldLabel:'导出',width:120,actionId:'exportOPENAPI',name:'exportOPENAPI',className:'hide'},
		         {type:'button',fieldLabel:'导出',width:120,name:'exportOPENAPI', fn: function(toolbar, store) {
						var sendAjax = function(xmlids) {
							var meta = new AI.Meta("OPENAPI");
							var metaInfo = meta.getMetaInfo("OPENAPI");
							var sql="select " + metaInfo.keyfield + ", " + metaInfo.namefield + ", API_TYPE,API_DESCR,TOPICCODE,REQUEST_URL,REQUEST_METHOD,RESPONSE_TYPE,CREATER, EFF_DATE, REMARK, VERSEQ,CURDUTYER,STATE,USE_NUMBER,USE_TIMES,SUGGEST_INDEX from " + metaInfo.tabname + " where xmlid in ("+xmlids+") order by " + metaInfo.keyfield;
						    var header = [
						        {"dataIndex":metaInfo.keyfield,"label":"API编码"},
						        {"dataIndex":metaInfo.namefield,"label":"API名称"},
						        {"dataIndex":"API_TYPE","label":"API分类"},
						        {"dataIndex":"API_DESCR","label":"API描述"},
						        {"dataIndex":"TOPICCODE","label":"主题"},
						        {"dataIndex":"REQUEST_URL","label":"请求地址"},
						        {"dataIndex":"REQUEST_METHOD","label":"请求方式"},
						        {"dataIndex":"RESPONSE_TYPE","label":"返回类型"},
						        {"dataIndex":"CREATER","label":"创建人"},
						        {"dataIndex":"EFF_DATE","label":"创建时间"},
						        {"dataIndex":"REMARK","label":"备注"},
						        {"dataIndex":"VERSEQ","label":"版本号"},
						        {"dataIndex":"CURDUTYER","label":"当前负责人"},
						        {"dataIndex":"STATE","label":"状态"},
						        {"dataIndex":"USE_NUMBER","label":"使用人数"},
						        {"dataIndex":"USE_TIMES","label":"使用次数"},
						        {"dataIndex":"SUGGEST_INDEX","label":"推荐指数"}
						    ];

						    //手工创建form表单
						    var submitForm = $("#form_column");
						    submitForm = $("<form id='form_column'></form>").appendTo("body");
						    submitForm.attr("method","post");
					        submitForm.attr("action",'/'+contextPath+'/ve/download?t=' + new Date().getTime());

					        var params = {};
						    params.xmlids = xmlids;
						    params.sql = sql;
						    params.header = ai.encode(header);;
						    params.fileName = "OPENAPI_" + new Date().format("yyyymmddhhmmss");
						    params.fileType = "excel";
						    params.objType = "OPENAPI";
						    params.sheetName = "OPENAPI信息";
						    
						    //创建input标签
						    for(var key in params){
						      var value = params[key];
						      var arr = [];
						      if(typeof value=='string'){
						        arr.push(value);
						      }else{
						        arr = value;
						      }
						      for(var i=0,l=arr.length;i<l;i+=1){
						        var newElement = document.createElement("input"); 
						        newElement.type='hidden';
						        newElement.name = key;
						        submitForm.append(newElement);
						        newElement.value = (arr[i]);
						      }
						    }
						    //手工提交
						    submitForm.submit();
						 };

						var ids = "";
						var data = ai.getStoreData(store.sql);
						for(var i=0; i<data.length; i++) {
							ids += "'" + data[i].XMLID + "',";
						}
						ids = ids.substring(0, ids.length-1);
						sendAjax(ids);
					}}
		],
		list:{
			title : '能力开放平台',
			sql : "SELECT a.*,'OPENAPI' AS OBJTYPE  FROM  DAG_META_API a ",
			tpl : '<div class="dacptiles panel panel-default " id="{{XMLID}}" title="{{API_NAME}}" objtype="OPENAPI"><div class="row"><div class="col-md-4">      <span class="glyphicon glyphicon-cloud" style="margin-top:1px;margin-left:10px;  font-size:48px;color:blue "></span>      </div><div class="col-md-8"><div style="margin-left:-60px;"><h5>{{API_NAME}}</h5><small>{{API_CODE}}</small><code style="right: 15px;top: 0px;position: absolute;">{{STATE}}</code></div></div></div><div class="row">    <div class="col-md-12">     <small>{{REQUEST_URL}}&nbsp</small></div></div><div class="row fieldinfo"></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"><div class="row pull-out"><div class="col-xs-4"><a href="#" actid="configColumn" class="metaaction" style="color:red"><div class="padder-v "><span class="m-b-xs h5 block">{{USE_NUMBER}}</span><small class="text-muted ">使用人数</small></div></a></div><div class="col-xs-4 dk"><a href="#" actid="rejectApplyData" class="metaaction" style="color:red"><div class="padder-v "><span class="m-b-xs h5 block">{{USE_TIMES}}</span><small class="text-muted ">使用次数</small></div></a></div><div class="col-xs-4"><a href="#" actid="agreeApplyData" class="metaaction" style="color:red"><div class="padder-v "><span class="m-b-xs h5 block" sugIndex="sugIndex_{{SUGGEST_INDEX}}"></span><small class="text-muted ">推荐指数</small></div></a></div></div></div></div>',
			detailurl:'/{contextPath}/ftl/datastore/apiDetail?objname={XMLID}',
			/*columns : [
			{
				header : "API编码",
				dataIndex : 'API_CODE',
				headerAlign : "center",
				dataAlign : "center",
				width : "80%",
				sortable : true,
				render : function(rowData, colVal) {
					var html = '<div class="media">'
							+ '<div class="media-left">'
							+ '<a href="#">'
							+ '    <img class="media-object" alt="" src="/'
							+ contextPath
							+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
							+ '  </a>'
							+ '</div>'
							+ '<div class="media-body">'
							+ '  <h4 class="media-heading">'
							+ rowData.API_CODE
							+ ","
							+ rowData.API_NAME
							+ '</h4>'
							+ '  <p><code>类别:'
							+ rowData.API_TYPE
							+ '&nbsp;&nbsp;</code>'
//							+ rowData.USE_TIMES
							+ ' <a type="button" class="btn btn-primary btn-xs pull-right">详细信息</a>	</p>'
							+ '  <p class="text-muted m-t-sm small">'
							+ rowData.API_DESCR
							+ '</p>'
							+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">Admin</a> <i class="fa fa-clock-o icon-muted"></i> Feb 20, 2013 <a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> 2 comments</a> </div>'
							// +' <p><button type="button" class="btn
							// btn-primary">申请数据</button></p>'
							+ '</div>'

							+ '</div>'
					return html;
				}
			}
			] */
			columns :[
				 {header : "API编码",dataIndex : 'API_CODE',headerAlign : "center",dataAlign : "center",width : "20%",sortable:true},
				 {header : "API名称",dataIndex : 'API_NAME',headerAlign : "center",dataAlign : "center",width : "20%"},
				 {header : "API分类",dataIndex : 'API_TYPE',headerAlign : "center",dataAlign : "center",width : "10%"},
				 {header : "主题",dataIndex : 'TOPICCODE',headerAlign : "center",dataAlign : "center",width : "10%"},
				 {header : "当前负责人",dataIndex : 'CURDUTYER',headerAlign : "center",dataAlign : "center",width : "10%"},
				 {header : "API描述",dataIndex : 'API_DESCR',headerAlign : "center",dataAlign : "center",width : "30%"
					 ,render:function(rowData,colVal){
						 if(colVal&&colVal.length >= 30){
							 return colVal.substr(0,30)+"..."
						 }
						 return colVal;
					 }
				 }
			]
		}
	},
	LABEL : {
		filter:[ 
		        {type:'label',name:'标签类型',code:'label_type',storesql:"select rowcode code,rowname name,parentcode FROM metaedimdef WHERE dimcode = 'DIM_LABEL_TYPE' and parentcode is null ORDER BY rowseq,rowcode",where:"label_type like '{selfval}%'",radioflag:'y',checkItems:'label_topicode'}
		        ,{type:'tree',name:'业务分类',code:'label_topicode',storesql:"select rowcode code,rowname name,parentcode FROM metaedimdef WHERE dimcode = 'DIM_LABEL_TOPIC' and rowcode like '%{val}%' ORDER BY rowseq,rowcode",where:"topiccode like '{selfval}%'",dependences:'label_type'}
		        ,{type:'label',name:'更新频率',code:'label_cycletype',storesql:"select rowcode code,rowname name,parentcode FROM metaedimdef WHERE dimcode = 'DIM_LABEL_CYCLE' ORDER BY rowseq,rowcode",where:"cycletype like '%{selfval}%'",radioflag:'y'}
		        ,{type:'label',name:'行业分类',code:'label_fieldtype',storesql:"select rowcode code,rowname name,parentcode FROM metaedimdef WHERE dimcode = 'DIM_LABEL_FIELD_TYPE' ORDER BY rowseq,rowcode",where:"field_type like '%{selfval}%'",radioflag:'y'}
		        ,{type:'label',name:'测试方法',code:'label_testmethod',storesql:"select rowcode code,rowname name,parentcode FROM metaedimdef WHERE dimcode = 'DIM_LABEL_TEST_METHOD' ORDER BY rowseq,rowcode",where:"test_method like '%{selfval}%'",radioflag:'y'}
		        ,{type:'text',name:'标签名称',code:'label_name',storesql:"",where:"(label_code like '%{selfval}%' or label_name like '%{selfval}%')",placeholder:"输入标签名称后点击空白区查询"}
		        ,{type:'text',name:'负责人',code:'label_curdutyer',storesql:"",where:"curdutyer like '%{selfval}%'",placeholder:"输入负责人名称后点击空白区查询"}
			],
		toolbar:[
		         // {type:'button',fieldLabel:'导出',width:120,actionId:'exportLABEL',name:'exportLABEL',className:'hide'}
					{type:'button',fieldLabel:'导出',width:120,name:'exportLABEL', fn: function(toolbar, store) {
						var sendAjax = function(where) {
						    //手工创建form表单
						    var submitForm = $("#form_column");
						    submitForm = $("<form id='form_column'></form>").appendTo("body");
						    submitForm.attr("method","post");
					        submitForm.attr("action",'/'+contextPath+'/meta/export?t=' + new Date().getTime());

					        var params = {};
						    params.xmlids = where;
						    params.fileName = "LABEL_";
						    params.fileType = "excel";
						    params.objType = "LABEL";
						    params.sheetName = "标签信息";
						    
						    //创建input标签
						    for(var key in params){
						      var value = params[key];
						      var arr = [];
						      if(typeof value=='string'){
						        arr.push(value);
						      }else{
						        arr = value;
						      }
						      for(var i=0,l=arr.length;i<l;i+=1){
						        var newElement = document.createElement("input"); 
						        newElement.type='hidden';
						        newElement.name = key;
						        submitForm.append(newElement);
						        newElement.value = (arr[i]);
						      }
						    }
						    //手工提交
						    submitForm.submit();
						 };

						var sql = store.sql;
						var where = "where 1=1 ";
						if(sql.indexOf("where") != -1) {
							where = sql.substring(sql.indexOf("where"), sql.length);
						}
						if(sql.indexOf("order by") == -1) {
							where += " order by LABEL_TYPE,LABEL_NAME";
						}  
						sendAjax(where);
					}}
		         ],
		list:{
			title : '标签',
			sql : "select XMLID,'LABEL' OBJTYPE,LABEL_CODE,LABEL_NAME,LABEL_TYPE,TOPICCODE,CYCLETYPE,SOURCE_TAB,SOURCE_COL,REMARK,CURDUTYER,STATE,TEST_METHOD,FIELD_TYPE,ACCURACY_RATE from dag_meta_label",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{LABEL_NAME}}" objtype="LABEL"> <header class="panel-heading"> <span class="part-one">{{CYCLECNTYPE}}</span> <span class="part-two">{{LABEL_NAME}}</span> <ul class="nav nav-pills pull-right"></ul> </header> <div class="row"> <div class="col-md-12" style="padding-left:30px;text-align:left;"> <h5> <b>{{LABEL_CODE}}<b></b></b> </h5> <b><b><small><b>{{LABEL_NAME}}&nbsp;</b></small></b></b> </div> </div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"> <div class="row pull-out"> <div class="col-xs-4"> <div class="padder-v"> <small class="m-b-xs h5 block">{{CREATER}}</small><small class="text-muted">创建人</small> </div> </div> <div class="col-xs-4 dk"> <div class="padder-v"> <small class="m-b-xs h5 block">{{CREATE_DATE}}</small><small class="text-muted">创建时间</small> </div> </div> <div class="col-xs-4"> <div class="padder-v"> <small class="m-b-xs h5 block">{{STATE}}</small><small class="text-muted">状态</small> </div> </div> </div> </div> </div>',
//			columns : [{header : "标签名",dataIndex : 'LABEL_NAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
//					render : function(rowData, colVal) {
//						var html = '<div class="media">'
//								+ '<div class="media-left">'
//								+ '<a href="#">'
//								+ '    <img class="media-object" alt="" src="/'
//								+ contextPath
//								+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
//								+ '  </a>'
//								+ '</div>'
//								+ '<div class="media-body">'
//								+ '  <h4 class="media-heading"><a href="#">'
//								+ rowData.LABEL_CODE.toLowerCase()
//								+ ","
//								+ rowData.LABEL_NAME
//								+ '</a></h4>'
//								+ '  <p><code>更新周期:'
//								+ rowData.CYCLETYPE
//								+ '</code>,分类：'+rowData.TOPICCNNAME+',<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a></p>'
//								+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
//								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">' + (rowData.CREATER||'--') + '</a> <i class="fa fa-clock-o icon-muted"></i> ' + rowData.CREATE_DATE + ' <a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
//								+ '</div>'
//								+ '</div>';
//						return html;
//					}
//				}
//			]
			columns :[
			 {header : "标签类型",dataIndex : 'LABEL_TYPE',headerAlign : "center",dataAlign : "center",width : "10%",dimStore:new AI.JsonStore({sql:"select rowcode rulecode,rowname rulename,parentcode from metaedimdef WHERE dimcode = 'DIM_LABEL_TYPE'",pageSize:-1})
			 ,sortable:true,render:function(rowData,colVal){
		            var topicStore = this.dimStore;
		          	if(!colVal||colVal=='null') return '未知';
		          	var topicNames = [];
		          	function getTopicName(topicCode){
		          		var dim = _.find(topicStore.root,function(obj){
		              		if(obj.RULECODE == topicCode) return obj;
		            		});
		          		topicNames.push(dim&&dim.RULENAME?dim.RULENAME:topicCode);
		            		if(!_.isUndefined(dim)&&dim.PARENTCODE) getTopicName(dim.PARENTCODE);
		          	}
		          	if(topicStore&&topicStore.getCount()>0){
		          		getTopicName(colVal);
		            	}
		          	var result = "";
		          	for(i=topicNames.length-1;i>=0;i--){
//		          		result += '/' + topicNames[i];
		          		result += topicNames[i];
		          	}
		          	return result||colVal;
		          }
			 },
			 {header : "业务分类",dataIndex : 'TOPICCODE',headerAlign : "center",dataAlign : "center",width : "20%",dimStore:new AI.JsonStore({sql:"select rowcode rulecode,rowname rulename,parentcode from metaedimdef WHERE dimcode = 'DIM_LABEL_TOPIC'",pageSize:-1})
			 ,sortable:true,render:function(rowData,colVal){
		            var topicStore = this.dimStore;
		          	if(!colVal||colVal=='null') return '未知';
		          	var topicNames = [];
		          	function getTopicName(topicCode){
		          		var dim = _.find(topicStore.root,function(obj){
		              		if(obj.RULECODE == topicCode) return obj;
		            		});
		          		topicNames.push(dim&&dim.RULENAME?dim.RULENAME:topicCode);
		            		if(!_.isUndefined(dim)&&dim.PARENTCODE) getTopicName(dim.PARENTCODE);
		          	}
		          	if(topicStore&&topicStore.getCount()>0){
		          		getTopicName(colVal);
		            	}
		          	var result = "";
		          	for(i=topicNames.length-1;i>=0;i--){
		          		result += '/' + topicNames[i];
		          	}
		          	return result||colVal;
		          }
			 },
			 {header : "标签内容",dataIndex : 'LABEL_NAME',headerAlign : "center",dataAlign : "center",width : "15%",sortable:true},
			 {header : "更新频率",dataIndex : 'CYCLETYPE',headerAlign : "center",dataAlign : "center",width : "10%",sortable:true},
			 {header : "测试方法",dataIndex : 'TEST_METHOD',headerAlign : "center",dataAlign : "center",width : "10%",sortable:true},
			 {header : "准确率",dataIndex : 'ACCURACY_RATE',headerAlign : "center",dataAlign : "center",width : "10%",sortable:true},
			 {header : "负责人",dataIndex : 'CURDUTYER',headerAlign : "center",dataAlign : "center",width : "10%",sortable:true},
			 {header : "标签说明",dataIndex : 'REMARK',headerAlign : "center",dataAlign : "center",width : "15%"
				 ,render:function(rowData,colVal){
					 if(colVal&&colVal.length >= 15){
						 return colVal.substr(0,15)+"..."
					 }
					 return colVal;
				 }
			 }
			]
		}
	},
	DIM : {
		filter:[ 
		        {type:'text',name:'维度名称',code:'dimid',storesql:"",where:"(dim_id like '%{selfval}%' or dim_name like '%{selfval}%')"}
			],
		toolbar:[
		          {type:'hidden',fieldLabel:'',width:120}
		         ],
		list:{
			title : '维度',
			sql : "select * from dim_table",
			tpl:'<div class="dacptiles select" id="{{XMLID}}" objtype="DIM" name="{{DIM_ID}}" title="{{DIM_NAME}}" style="width: 80px;height: 80px; overflow:hidden"><span class="glyphicon glyphicon-certificate" aria-hidden="true" style="margin-top: 5px;margin-bottom: 10px;font-size: 32px"></span><span class="title" style="display: block;text-align: center;word-wrap: break-word;font-size: 12px;">{{DIM_NAME}}</span></div>',
			columns : [{header : "维度名称",dataIndex : 'DIM_NAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/dim.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.DIM_ID.toLowerCase()
								+ ","
								+ rowData.DIM_NAME
								+ '</a></h4>'
								+ '  <p><code>模型名:'
								+ rowData.SOURCE_TABLE
								+ '</code>,父维度：'+rowData.DIM_PID+',<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a></p>'
								//+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
								//+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">' + (rowData.CREATER||'--') + '</a> <i class="fa fa-clock-o icon-muted"></i> ' + rowData.CREATE_DATE + ' <a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	},
	META : {
		filter:[ 
		        {type:'label',name:'对象类型',code:'objtype',storesql:"select distinct objtype,objname cnname from metaobjmodel where objtype in ('INTER', 'PROC', 'TAB', 'ZB', 'DATAFLOW', 'TRANSFLOW', 'APP')",where:"objtype in('{selfval}')",radioflag:'y'}
		        ,{type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')",radioflag:'y',checkItems:'rulecode'}
		        ,{type:'label',name:'业务主题',code:'rulecode',storesql:"select distinct rulecode code,rulename name,parentcode from metadb_struct where dbname='{val}'",where:"topiccode like '{selfval}%'",radioflag:'y'}
		        //,{type:'text',name:'名称',code:'keyval',storesql:"",where:"(objname like '%{selfval}%' or objcnname like '%{selfval}%')"}
			],
		toolbar:[
		         //{type:'hidden',fieldLabel:'',width:120}
		         {type:'button',fieldLabel:'导出',width:120,actionId:'exportTAB',name:'exportTAB'}
		         ],
		list:{
			title : '数据',
			sql : "select * from metaobj a where objtype in ('INTER', 'PROC', 'TAB', 'ZB', 'DATAFLOW', 'TRANSFLOW', 'APP') and ((objname like '%{objname}%' or objcnname like '%{objname}%' ) OR EXISTS (SELECT DISTINCT b.xmlid FROM column_val b WHERE  a.XMLID = b.xmlid AND (colname LIKE '%{objname}%' OR colcnname LIKE '%{objname}%')))",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{OBJNAME}}" objtype="{{OBJTYPE}}"> <header class="panel-heading"> <strong class="part-one">类型：{{OBJCNTYPE}}</strong> <span class="part-two"></span> <ul class="nav nav-pills pull-right"></ul> </header> <div class="row"> <div class="col-md-12" style="padding-left:30px;text-align:left;"> <h5> <b>{{OBJNAME}}<b></b></b> </h5> <b><b><small><b>{{OBJCNNAME}}&nbsp;</b></small></b></b> </div> </div> <div class="row fieldinfo"></div> <div class="panel-footer bg-light lter text-center" style="margin-top:10px"> <div class="row pull-out"> <div class="col-xs-4"> <div class="padder-v"> <small class="m-b-xs h5 block">{{DBCNNAME}}</small><small class="text-muted">数据库</small> </div> </div> <div class="col-xs-4 dk"> <div class="padder-v"> <small class="m-b-xs h5 block">{{TOPICCODE}}</small><small class="text-muted">主题</small> </div> </div> <div class="col-xs-4"> <div class="padder-v"> <small class="m-b-xs h5 block">{{STATE_DATE}}</small><small class="text-muted">状态时间</small> </div> </div> </div> </div> </div>',
			columns : [{header : "数据库",dataIndex : 'DBNAME',headerAlign : "center",dataAlign : "center",width : "80%",sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.OBJNAME
								+ ","
								+ rowData.OBJCNNAME
								+ "&nbsp;&nbsp;&nbsp;&nbsp;<strong>数据类型：" 
								+ rowData.OBJTYPE
								+ '</strong></a></h4>'
								+ '  <p><code>数据库:'
								+ getDbCnName(colVal)
								+ '</code>,创建团队:'+getTeamCnName(rowData.TEAM_CODE)+',主题：'+getTopicCnName(rowData.TOPICCODE)+',<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a></p>'
								+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">' + (rowData.CURDUTYER||'--') + '</a> <i class="fa fa-clock-o icon-muted"></i> ' + rowData.STATE_DATE + ' <a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			]
		}
	}
}
//获取数据库编码
var dbnameJson={};
var dbnameStore = new AI.JsonStore({
	sql:"SELECT dbname,cnname FROM metadb_list",
	pageSize:-1,
	key:"DBNAME"
});
for(i=0;i<dbnameStore.root.length;i++){
	dbnameJson[dbnameStore.root[i].DBNAME]=dbnameStore.root[i].CNNAME;
};
//获取主题信息
var topicJson={};
var topicStore = new AI.JsonStore({
	sql:"SELECT rulecode,rulename FROM metadb_struct",
	pageSize:-1,
	key:"RULECODE"
});
for(i=0;i<topicStore.root.length;i++){
	topicJson[topicStore.root[i].RULECODE]=topicStore.root[i].RULENAME;
};
//获取团队信息
var teamJson={};
var teamStore = new AI.JsonStore({
    sql:"select team_code,team_name from meta_team",
    pageSize:-1,
    key:"TEAM_CODE"
});
for(i=0;i<teamStore.root.length;i++){
	teamJson[teamStore.root[i].TEAM_CODE]=teamStore.root[i].TEAM_NAME;
};


var metaedimdefJson={};
//{DIM_LAB_CYCLE:{dimcode:'DIM_LAB_CYCLE',dimname:'表周期',element:[{rowcode:'day',rowname:'日'},{rowcode:'month',rowname:'月'},...]},DIM_ZB_CYCLE:...}
var metaedimdefStore=ai.getJsonStore("select dimcode,dimname,rowcode,rowname from metaedimdef");
for(i=0;i<metaedimdefStore.root.length;i++){
	var row=metaedimdefStore.root[i];
    if(!metaedimdefJson.hasOwnProperty(row.DIMCODE)){
    	metaedimdefJson[row.DIMCODE]={dimcode:row.DIMCODE,dimname:row.DIMNAME,element:[{rowcode:row.ROWCODE,rowname:row.ROWNAME}]};
    }else{
    	metaedimdefJson[row.DIMCODE].element.push({rowcode:row.ROWCODE,rowname:row.ROWNAME});
    }
}

function getDbCnName(enname){
	return dbnameJson.hasOwnProperty(enname)?dbnameJson[enname]:enname;
}
function getTeamCnName(enname){
	return teamJson.hasOwnProperty(enname)?teamJson[enname]:enname;
}
function getTopicCnName(enname){
	return topicJson.hasOwnProperty(enname)?topicJson[enname]:enname;
}
function getRowName(dimcode,rowcode){
	if(metaedimdefJson.hasOwnProperty(dimcode)){
		for(i=0;i<metaedimdefJson[dimcode].element.length;i++){
			if(metaedimdefJson[dimcode].element[i].rowcode==rowcode){
				return metaedimdefJson[dimcode].element[i].rowname;
			}
		}
	}
	return rowcode;
}
